home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / console / svgatext.3 / svgatext / SVGATextMode-1.3 / contrib / Ultra2Linux / Ultra2Linux.c < prev   
Encoding:
C/C++ Source or Header  |  1995-02-15  |  1.4 KB  |  61 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* Copyright (c) 1995, Kenneth Albanowski */
  5.  
  6. char buffer[64000];
  7.  
  8. int main(int argc,char*argv[]) {
  9.         int w,h;
  10.         unsigned char pos;
  11.  
  12.         if(argc<2) {
  13.                 fprintf(stderr,
  14. " Convert between UltraVision fonts and linux fonts
  15.  
  16. Usage: %s height width < uvfont > linuxfont
  17.  
  18. For example: %s 20 9 < newfont.f20 > newfont
  19.  
  20. If you are going to be displaying the font as a 9-pixel wide font, be sure
  21. so give a width of 9 so that any 9-bit data will be recognized and used.
  22.  
  23. Also note: Fonts included with UltraVision or otherwise provided by 
  24. Personics, Inc. (The makers of UltraVision.) are copyrighted, and may not
  25. be distributed in any form.
  26.  
  27. This software is provided only for the purpose of converting UltraVision 
  28. fonts for your own personal use.
  29.  
  30. ",argv[0],argv[0]);
  31.                 exit(0);
  32.         }
  33.  
  34.         h=atoi(argv[1]);
  35.         w=atoi(argv[2]);
  36.  
  37.         fread(buffer,1,h*256,stdin);
  38.  
  39.         fprintf(stderr,"Read 256 characters of %d bytes each.\n",h);
  40.  
  41.         if(w!=9)
  42.                 goto done;
  43.  
  44.         while(1) {
  45.                 fread(&pos,1,1,stdin);
  46.                 if(feof(stdin) || ferror(stdin))
  47.                         goto done;
  48.                 fprintf(stderr,"Reading 9-bit character %d.\n",pos);
  49.                 fread(&buffer[pos*h],1,h,stdin);
  50.         }
  51.  
  52.  
  53.         done:
  54.         fwrite(buffer,1,h*256,stdout);
  55.  
  56.         fprintf(stderr,"Done.\n");
  57.  
  58.     exit(0);
  59. }
  60.  
  61.